import { SimplePlayerVO } from "./SimplePlayerVO";
import { GameDataManager } from "../../Managers/GameDataManager";
export class PlayerVO extends SimplePlayerVO {
	public static ClassName: string = "PlayerVO";
	

	private _deskPos : number = null //玩家位置
	private _acId : number = null
	private _isReady : boolean = null
	private _sex : number = null
	private _isExit : boolean = null
	private _headUrl : string = null
	private _score : number = null
	private _ip : string = null
	private _offline : boolean = null
	private _nickname :string = null
	private _folds : number[] = []
	private _canPai : boolean = false //是否可以出牌



	/**
	 * set canPai
	 */
	public set canPai(v:boolean) {
		this._canPai = v
	}

	public get canPai() : boolean{
		return this._canPai
	}

	public set Folds(v : number[]) {
		this._folds = v
	}

	public get Folds() : number[]{
		return this._folds
	}

	public addFolds(mj:number) : void {
		this._folds.push(mj)
	}

	public rmFolds (mj:number): void {
		if(mj < 0)return
		let idx = this._folds.indexOf(mj)
		this._folds.splice(idx,1)
	}

	public set nickname(v:string) {
		this._nickname = v
	}
	
	public get nickname() : string{
		return this._nickname
	}

	public set deskPos(v:number) {
		this._deskPos = v
	}
	public get deskPos() : number{
		return this._deskPos
	}

	public set acId(v:number) {
		this._acId = v
	}
	public get acId() : number{
		return this._acId
	}


	public set isReady(v:boolean) {
		this._isReady = v
	}
	public get isReady() : boolean{
		return this._isReady
	}

	public set sex(v:number) {
		this._sex = v
	}
	public get sex() : number{
		return this._sex
	}

	public set isExit(v:boolean) {
		this._isExit = v
	}
	public get isExit() : boolean{
		return this._isExit
	}

	public set headUrl(v:string) {
		this._headUrl = v
	}
	public get headUrl() : string{
		return this._headUrl
	}


	public set score(v:number) {
		this._score = v
	}
	public get score() : number{
		return this._score
	}
	
	public set ip(v:string) {
		this._ip = v
	}

	public get ip() : string{
		return this._ip
	}

	public set offline(v:boolean) {
		this._offline = v
	}

	public get offline() : boolean{
		return this._offline
	}


	public inject(src:object) : void {
		if (src == null) {
            return;
        }
        for (var key in src) {
            if (src[key] != null) {
                this[key] = src[key];
            }
            // if(this[key] == undefined || typeof src[key] != 'object'){
            // 	this[key] = src[key];
            // }else{
            // 	this.inject(src[key]);
            // }
        }
	}

}